﻿using System.Windows.Forms;

namespace Swsk33.SimpleArcEngine.Dialog
{
	/// <summary>
	/// 用于添加文本元素时写入内容
	/// </summary>
	public partial class TextDialog : Form
	{
		private bool isOk = false;

		public TextDialog()
		{
			InitializeComponent();
		}

		/// <summary>
		/// 显示文字对话框并返回框内文字
		/// </summary>
		public string ShowTextDialog()
		{
			ShowDialog();
			if (isOk)
			{
				return content.Text;
			}
			else
			{
				return "";
			}
		}

		private void ok_Click(object sender, System.EventArgs e)
		{
			isOk = true;
			Close();
		}

		private void cancel_Click(object sender, System.EventArgs e)
		{
			isOk = false;
			Close();
		}
	}
}